using "simplicialComplexGenerator" as SCG

-- id | alias
-- -------------------------------------
-- i  | K1v3
-- j  | K2v7

expand SimplicialComplex K {
   SCG.SimplicialComplex(K.id)
   -- generate list of elements:
   --    Vertex Kv0, Kv1, Kv2, ..., KvN in K
   --    Edge Ke0, Ke1, Ke2, ..., KeN in K
   --    Face Kf0, Kf1, Kf2, ..., KfN in K

   -- NOTE: Penrose (or the external program?)
   -- will be responsible for prepending the id
   -- of K to the id of the individual elements,
   -- so that these elements have unique IDs
}

-- Not sure whether this is an expansion statement
expand Vertex v
where In(v, K) {
   v.alias := SCG.VertexOf(K.id)
   -- RHS returns the name of one of the
   -- vertices in the mesh (say, "Kv3")
}

-- If this has replacement semantics...
-- It's about instantiating S by replacing the Star line. But all that extra info in the selector makes it unclear.
expand SimplicialSet S
with SimplicialComplex K, Vertex v
where S := Star(v), S Subset K {
   SCG.VertexStar(K.id, S.id, v.alias)
   -- How do you know v has been aliased?
   -- generate list of elements:
   --    Kv3, Kv5, Kv11, ..., Kv13 in S
   --    Ke2, Ke7, Ke9, ..., Ke14 in S
   --    Kf1, Kf2, Kf3, ..., Kf4 in S
   -- with some connectivity info:
   -- InEdge(kv3, kv5, ke2)...
}

expand SimplicialComplex A
with SimplicialComplex K, SimplicialSet S
where A := Closure(S), S Subset K {
   SCG.Closure( K.id, S.id, A.id )
   -- generate list of elements:
   --    Kv6, ..., Kv8 in A
   --    Ke7, ..., Ke9 in A
   --    Kf8, ..., Kf9 in A
}
